let path = require("path");
class Plu {
  apply(complier) {
    console.log("start");
    complier.hooks.emit.tap("emit", function () {
      console.log("emit");
    });
  }
}
class Plug {
  apply(complier) {
    console.log("Plug");
    complier.hooks.afterPlugins.tap("afterPlugins", function () {
      console.log("afterPlugins");
    });
  }
}
module.exports = {
  mode: "development",
  entry: "./src/index.js",
  output: {
    filename: "bundle.js",
    path: path.join(__dirname, "dist"),
  },
  module: {
    rules: [
      {
        test: /\.less$/,
        use: [
          path.resolve(__dirname, "loader/style-loader.js"),
          path.resolve(__dirname, "loader/less-loader.js"),
        ],
      },
    ],
  },
  plugins: [new Plu(), new Plug()],
};
